<script src="<?php echo base_url() . 'assets/js/app/list.js'; ?>"></script>
 <link rel="stylesheet" href="<?php echo base_url() . 'assets/js/themes/base/jquery.ui.all.css'; ?>"/>
	<script src="<?php echo base_url() . 'assets/js/jquery-1.9.1.js'; ?>"></script>
	<script src="<?php echo base_url() . 'assets/js/ui/jquery.ui.core.js'; ?>"></script>
	<script src="<?php echo base_url() . 'assets/js/ui/jquery.ui.widget.js'; ?>"></script>
	<script src="<?php echo base_url() . 'assets/js/ui/jquery.ui.datepicker.js'; ?>"></script>
	<script>
	<?php
	foreach($results as $row) {
	?>
		$(function() {
			$("#created_date<?php echo $row->id;?>").datepicker();
		});
	<?php
		}
	?>
	</script>
<?php echo anchor(base_url(), "Home"); ?>
&nbsp
<?php echo anchor("article/Article/create", "Create"); ?>
<!--search meta data-->
<?php echo $meta_search_form;?>
<!--search by parent-->
<?php echo form_open("article/Article/search_by_parent"); ?>
<table>
  <tr>
    <td><label for="catalog_id">Catalog</label></td>
    <td>
    	<select name="catalog_id" id="catalog_id">
    		<option value=""></option>
    	<?php foreach ($parent_list as $catalog) { ?>
    		<option value="<?php echo $catalog -> id; ?>" <?php echo set_select('catalog_id', $catalog->id)?> <?php
			if(count($params) > 0) {
				if ($params['catalog_id'] == $catalog->id)
					echo 'selected';
			}
		?>><?php 
		echo $catalog -> catalog_name; ?></option>
    	<?php } ?>
    	</select>
    </td>
    <td><input type="submit" name="seach" value="Filter"/></td>
  </tr>
</table>
<?php echo form_close(); ?>
<!--End-->
<form action="<?php echo site_url('article/Article/delete_all');?>" method="post" onsubmit="return is_check()">
<table>
  <tr>
  	<th><input type="checkbox" onClick="toggle(this)" /></th>
    <th>Id</th>
    <th align="left">Image</th>
    <th align="left">Title</th>
    <th align="left">Created date</th>
    <th align="left">Summary</th>
  </tr>
<?php if(isset($results)) : foreach($results as $row):?>
  <tr height="35" id="<?php echo "tr_data".$row -> id;?>" onmousemove ="show_action_bar(<?php echo $row -> id;?>)" onmouseout="hide_action_bar(<?php echo $row -> id;?>)" >
    <td><input type="checkbox" name="delete_id[]" value="<?php echo $row->id;?>"></td>
    <td><?php echo $row -> id; ?><br/></td>
    <td width="50%">
    		<?php echo $row -> title; ?><br/>
    	<div id="<?php echo 'bar'.$row -> id;?>">
    		<?php echo anchor("article/Article/update/" . $row -> id, "Edit"); ?>
    		<a href="#" onclick="show_quick_edit(<?php echo $row -> id;?>)">Quick edit</a> 
    		<?php echo anchor("article/Article/show/" . $row -> id, "Show"); ?>
    	</div>
    </td>
    <td><?php echo $row -> created_date; ?></td>
    <td><?php echo $row -> summary; ?></td>
    <?php ?>
  </tr>
  <tr id="<?php echo "tr".$row -> id;?>"> 
  	<td colspan="5">
  		<?php echo form_open("article/Article/quick_update"); ?>
  		<input type="hidden" name="id" id="id" value="<?php echo set_value('id', $row -> id); ?>"/>
  		<table>
		  <tr>
		    <td><label for="title">Title</label></td>
		    <td><input type="text" name="<?php echo 'title'.$row -> id;?>" id="<?php echo 'title'.$row -> id;?>" value="<?php echo set_value('title', $row -> title); ?>"/></td>
		  </tr>
		  <tr>
		    <td><label for="created_date">Created date</label></td>
		    <td><input type="text" name="<?php echo 'created_date'.$row -> id;?>" id="<?php echo 'created_date'.$row -> id;?>" value="<?php echo set_value('created_date', $row -> created_date); ?>"/></td>
		  </tr>
		  <tr>
		    <td><label for="summary">Summary</label></td>
		    <td><input type="text" name="<?php echo 'summary'.$row -> id;?>" id="<?php echo 'summary'.$row -> id;?>" value="<?php echo set_value('summary', $row -> summary); ?>"/></td>
		  </tr>
  		<tr>	
  			<td><input type="submit" value="Update"/></td>
  			<td><input type="button" value="Cancel" onclick="show_quick_edit(<?php echo $row -> id;?>)"/></td>
  		</tr>
	</table>
	<?php echo form_close(); ?>
  	</td>
  </tr>
    <?php endforeach; ?>
    <?php endif; ?>
    <tr><td colspan="5" align="center"><?php echo $pagination_link; ?></td></tr>
</table>

<input type="submit" name="delete" value="Delete" />
</form>

<script type='text/javascript' language='javascript'>
<?php
	foreach($results as $row) {
?>
show_quick_edit(<?php echo $row->id;?>);
hide_action_bar(<?php echo $row->id;?>);
<?php
}
?>
</script>